<div class="col-md-6">
    <div class="form-group">
        <div class="col-md-4" style="padding-bottom: 10px;">
            <button type="button" class="btn btn-success btn-block" onclick="add_data();">Add Area</button>
        </div>
    </div>
</div>
<div id="tablecontent" class="col-md-12">						
    <div class="form-group">
        <div class="table-responsive">
            <table class="table table-bordered table-condensed table-striped" style="background:#f9f9f9;">
                <thead>
                    <tr>
                        <th class="tblhead" style="width:5%;text-align:center;">No</th>
						<th class="tblhead" style="width:30%;text-align:center;">Regional Name</th>
						<th class="tblhead" style="width:26%;text-align:center;">Office Name</th>
						<th class="tblhead" style="width:13%;text-align:center;">Type</th>
						<th class="tblhead" style="width:13%;text-align:center;">Status</th>
						<th class="tblhead" style="width:13%;text-align:center;">Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    if (empty($list_data)) {
                        ?>
                        <tr><td colspan="8" style="text-align:center">No Data Available</td></tr>
                        <?php
                    } else {
                        foreach ($list_data as $row) {
                            ?>
                            <tr>
                                <?php
                                $id = $row["AREA_ID"];
                                $name = $row["AREA_NAME"];
                                $desc = $row["AREA_DESC"];
                                $status = $row["AREA_STATUS"];
                                $regional_name = $row["REGIONAL_NAME"];
                                $type = $row["ISDOMESTIC"];
                                $messenger = $row["ISMESSENGER"];

                                $area_type = ($type == 'Y') ? 'Domestik' : 'Internasional';
                                $area_status = ($status == 'Y') ? 'Active' : 'Not Active';
                                ?>

                                <td style="text-align:center;"><?php echo $row["RECNUM"]; ?>.</td>
                                <td style="text-align:left;"><?php echo ucfirst($name) . ' - ' . ucfirst($desc); ?></td>
                                <td style="text-align:left;"><?php echo ucfirst($regional_name); ?></td>
                                <td style="text-align:center;"><?php echo $area_type; ?></td>
                                <td style="text-align:center;">
                                    <?php if ($status == 'Y') : ?>
                                        <a class="btn btn-sm btn-primary" href="#" onclick="activation('<?php echo $id ?>', '<?php echo $status ?>');">
                                            <?php echo $area_status; ?></a>
                                    <?php else: ?>
                                        <a class="btn btn-sm btn-danger" href="#" onclick="activation('<?php echo $id ?>', '<?php echo $status ?>');">
                                            <?php echo $area_status; ?></a>
                                    <?php endif; ?>
                                </td>
                                <td style="text-align:center;">
                                    <a class="btn btn-sm btn-warning" href="#" onclick="edit_data('<?php echo $id ?>');">
                                        Edit</a>
                                </td>
                            </tr>
                            <?php
                        }
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="form-group">
        <div id="mypaging">
            <?php
            echo $paging;
            echo $jump_page;
            echo $ipp;
            ?>
        </div>								
    </div>						
</div>